<div id="user">
<?php if(Auth::instance()->isAuth()): ?>
<?php printf(L::selected()->loggedInAs, Auth::instance()->getUser()->username);?> 
<a href="<?php echo APPBASE?>action/logout?redir=<?php 
	echo urlencode(getenv('REQUEST_URI'));?>"><strong><?php 
	echo L::selected()->logOut;?></strong></a>
<?php else: ?>
<?php echo L::selected()->notLoggedIn; ?> 
<a href="<?php
	$request_uri = getenv('REQUEST_URI');
	if(strpos($request_uri, APPBASE.'action/login') === 0)
		echo $request_uri;
	else
		echo APPBASE.'action/login?redir='.urlencode($request_uri);
?>"><strong><?php echo L::selected()->logIn;?></strong></a>
<?php endif; ?>
</div> <!-- end user -->
